package org.xin.framework.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;
import org.xin.framework.base.pojo.entity.IBaseEntity;
import org.xin.framework.base.pojo.entity.IBaseSimpleEntity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author ：xin
 * @date ：Created in 2021/9/29
 * @desc <p>  </p>
 * @modified By：$
 * @version: $
 */
@ApiModel(description = "系统模块-字典Entity")
@Getter
@Setter
@ToString(callSuper = true)
//@Accessors(chain = true)
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "sys_dictionary")
public class SysDictionary extends IBaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "字典编码不能为空")
    @Length(max = 100, message = "字典编号不能超过100个字符")
    @Pattern(regexp = "^[A-Za-z0-9]*$", message = "字典编码只能是字母和数字且必须包含至少一个字母")
    private String code;

    @NotBlank(message = "字典名称不能为空")
    @Length(max = 100, message = "字典名称不能超过100个字符")
    private String name;
}
